package com.fingard.dsp.bank.reqrespobj.balance;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.balance.detail.RetAtsHisBalDetail;
import com.fingard.xml.XmlTextWriter;

//历史余额响应对象
public class RetAts7505HisBalQry extends RetAtsBase {

    public RetAts7505HisBalQry(ReqRespHeader p_header){
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }

    private int writeRdCount = 0;
    public int getWrittenRdCount(){
        return writeRdCount;
    }
    public void writeRetDetail(RetAtsHisBalDetail p_retDetail) throws Exception{
        writeRdCount++;
        if(writeRdCount == 1){
            if(!hasWrittenRespCode){
                writeRespCode("0");
            }
            if(!hasWrittenRespInfo){
                writeRespInfo("");
            }
        }
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("ActBal", p_retDetail.actBal);
        retXmlWriter.writeElementString("AvailBal", p_retDetail.availBal);
        retXmlWriter.writeElementString("BalDate", p_retDetail.balDate);
        retXmlWriter.writeElementString("CashPoolBal", p_retDetail.cashPoolBal);
        retXmlWriter.writeElementString("CashPoolAvailBal", p_retDetail.cashPoolAvailBal);
        retXmlWriter.writeEndElement();
    }
}
